<style lang="less">
  .news-card-container {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #eeeeee;
    .news-card-info {
      flex: 1;
      display: flex;
      flex-direction: column;
      .news-card__desc {
        margin-top: 12px;
      }
    }
    .news-card__img {
      overflow: hidden;
      border-radius: 3px;
      width: 100px;
      height: 60px;
    }
  }
</style>

<template>
  <div class="news-card-container" @click="goDetail">
    <div class="news-card-info">
      <div class="news-card__title text-ellipsis-2 fz-colmun-title color-title">{{ title }}</div>
      <div class="news-card__desc fz-annotation1 color-sec-text">{{ value }}</div>
      <div v-if="desc" class="news-card__desc fz-annotation1 color-sec-text">{{ desc }}</div>
    </div>
    <img v-if="imgUrl" class="news-card__img" :src="imgUrl" />
  </div>
</template>

<script>
export default {
  props: {
    id: {
      type: [String, Number],
      default: ''
    },
    title: {
      type: String,
      default: ''
    },
    value: {
      type: String,
      default: ''
    },
    desc: {
      type: String,
      default: ''
    },
    imgUrl: {
      type:String,
      default: ''
    }
  },
  methods: {
    goDetail() {
      if (this.id) this.$router.push({ path: `/pages/nCov/article?id=${this.id}` })
    }
  }
}
</script>
